package com.haipumi.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.haipumi.beans.DataGrid;
import com.haipumi.beans.haipumi_chatInfo;
import com.haipumi.biz.IBackChatInfoBiz;
import com.haipumi.biz.impl.BackChatInfoBizImpl;

public class ChatInfoServlet extends CommonServlet {

	IBackChatInfoBiz ibcib=new BackChatInfoBizImpl();
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String op=null;
		op=request.getParameter("op");
		if("findallchatinfo".equals(op)){			
			findallchatinfo(request,response);
		}
	}

	private void findallchatinfo(HttpServletRequest request,
			HttpServletResponse response) {
		List<haipumi_chatInfo>chatinfolist=null;
		chatinfolist=ibcib.findAllChatInfo();
		int r=0;
		r=ibcib.countAllChatInfo();
		DataGrid dg=new DataGrid();
		dg.setRows(chatinfolist);
		dg.setTotal(r);
		super.outData(response, dg);
	}

}
